﻿@using QDT.Core.Projects
@section HeadSection
{
    @Html.IncludeScript("~/Content/JS/config.js")
    @Html.IncludeScript("~/Content/JS/project.js")
}
<div class="main_title">
    新增 <a href="@Url.Action("Index", "Loan")" class="back_list">返回列表</a></div>
<div class="blank5">
</div>
@using (Html.BeginForm("PostAddLoan", "Loan")) {
    <div class="button_row">
    </div>
    <div class="blank5">
    </div>
    <div class="conf_tab">
        <table class="form">
            <tr>
                <td colspan="2" class="topTd">
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    贷款名称:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" style="width: 500px;" name="Name" />
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    简短名称:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox" name="SubName" value="--" />
                    <span class="tip_span">[用于邮件，短信的显示，字数不得超过20个字]</span>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    会员ID:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="UserID" />
                    <span class="warning_span">[关键信息，一旦添加不能修改]</span>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    类型:
                </td>
                <td class="item_input">
                    <select id="TypeID" name="TypeID" onclick=" changeCate(this) ">
                        @foreach (ProjectType type in ViewData["ProjectTypes"] as List<ProjectType>) {
                            if ("1,5,9,10".Contains(type.ID.ToString()))
                            {
                                continue;
                            }
                            <option value="@type.ID">@type.Name</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    担保机构:
                </td>
                <td class="item_input">
                    <select id="AgencyID" name="AgencyID" style="width: 300px;">
                        <option value="0">请选择</option>
                        @foreach (ProjectAgency agency in ViewData["ProjectAgencys"] as List<ProjectAgency>)
                        {
                            <option value="@agency.ID">@agency.Name</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    安全保障:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="warrant" style="width: 500px;"/>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    总借款额:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="BorrowAmount" />
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    借款用途:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="loanPurpose" />
                </td>
            </tr>
            <tr  style="display: none">
                <td class="item_title">
                    贷款缩略图:
                </td>
                <td class="item_input">
                    @Html.UploadImage("Icon")
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    还款方式:
                </td>
                <td class="item_input">
                    <select id="RepaymentID" name="RepaymentID">
                        <option value="@ParentProject.DAY_INTEREST_PAYMENT">按日计息</option>
@*                        <option value="@ParentProject.MONTH_INTEREST_PAYMENT">按月计息</option>*@
                    </select>
                    <script type="text/javascript">
                        $(function () {
                            $('#RepaymentID').change(function () {
                                var e = $(this).val();
                                if (e == '@ParentProject.DAY_INTEREST_PAYMENT') {
                                    $('#SettleDay_Box').show();
                                } else {
                                    $('#SettleDay_Box').hide();
                                }
                            }).change();
                        });
                    </script>
                    <span class="warning_span">[关键信息，一旦添加不能修改]</span>
                </td>
            </tr>
            <tr id="SettleDay_Box">
                <td class="item_title">利息结算日:</td>
                <td>
                    <select id="SettleDay" name="SettleDay">
                        @for (int i = 1; i < 29; i++) {
                            <option value="@i" @(i==15 ? "selected=selected" : "") >@i</option>
                        }
                    </select>
                    <span class="warning_span">[关键信息，一旦添加不能修改]</span>
                </td>
            </tr>
@*            <tr>*@
@*                <td class="item_title">*@
@*                    借款金额:*@
@*                </td>*@
@*                <td class="item_input">*@
@*                    <input type="text" class="textbox require" name="BorrowAmount" />*@
@*                </td>*@
@*            </tr>*@
            <tr>
                <td class="item_title">
                    借款期限:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="RepayTime" size="5" />
                    <select name="repayTimeType">
                        <option value="0">天</option>
                        <option value="1" selected="selected">月</option>
                    </select>
                    <span class="warning_span">[关键信息，一旦添加不能修改]</span>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    年利率:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="Rate" size="5" value="12" /> %
                    <span class="warning_span">[关键信息，一旦添加不能修改]</span>
                </td>
            </tr>
            <tr  style="display: none">
                <td class="item_title">
                    筹标期限:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox" name="EndDate" size="5" value="7" />
                    <span class="warning_span">[关键信息，一旦添加不能修改]</span>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    所属行业:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="Industry" />
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    公司名称:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox require" name="IndustryDetail" />
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    贷款描述:
                </td>
                <td class="item_input">
                    <textarea class="textbox require" class="textarea" id="Description" name="Description" style="width:700px;height:400px;"></textarea>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    贷款信息:
                </td>
                <td class="item_input">
                    <textarea class="textarea" id="LoanInfo" name="LoanInfo" style="width:700px;height:400px;"></textarea>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    项目历程:
                </td>
                <td class="item_input">
                    <textarea class="textarea" id="ProjectProcess" name="ProjectProcess" style="width:700px;height:400px;"></textarea>
                </td>
            </tr>
            <tr>
                <td class="item_title">
                    风险控制:
                </td>
                <td class="item_input">
                    <textarea class="textarea" id="RiskControl" name="RiskControl" style="width:700px;height:400px;"></textarea>
                </td>
            </tr>
            <tr  style="display: none">
                <td class="item_title">
                    状态:
                </td>
                <td class="item_input">
                    <label>
                        有效<input type="radio" name="IsEffect" value="true" checked="checked" /></label>
                    <label>
                        无效<input type="radio" name="IsEffect" value="false" /></label>
                </td>
            </tr>
            <tr  style="display: none">
                <td class="item_title">
                    排序:
                </td>
                <td class="item_input">
                    <input type="text" class="textbox" name="Sort" value="0" />
                </td>
            </tr>
            <tr>
                <td colspan="2" class="bottomTd">
                </td>
            </tr>
        </table>
    </div>
    <div class="blank5">
    </div>

    <table class="form" cellpadding="0" cellspacing="0">
        <tr>
            <td colspan="2" class="topTd">
            </td>
        </tr>
        <tr>
            <td class="item_title">
            </td>
            <td class="item_input">
                <!--隐藏元素-->
                <input type="submit" class="button" value="新增" />
                <input type="reset" class="button" value="重置" />
            </td>
        </tr>
        <tr>
            <td colspan="2" class="bottomTd">

            </td>
        </tr>
    </table>
}

@*<script type="text/javascript">*@
@*     var editor;*@
@*     KindEditor.ready(function(keditor) {*@
@*         editor = keditor.create('.textarea', {*@
@*             allowFileManager: true,*@
@*            uploadJson: '/Home/UploadImage',*@
@*         });*@
@*     });*@
@*</script>*@